<script setup lang="ts">

import {ref, watch} from "vue";

const props = defineProps(["label", "placeholder"])
const model = defineModel()

let showInput = ref(false)

</script>

<template>
  <el-input v-if="showInput" v-model="model" :placeholder="placeholder"></el-input>
  <el-button v-if="showInput" link style="margin-top: 3px" type="info"
             @click="showInput = false">取消</el-button>
  <el-button v-else type="primary" link @click="showInput = true">{{label}}</el-button>
</template>

<style scoped>

</style>